package com.huiztech.maystall.activity;

import com.huiztech.maystall.mvc.Controller;
import com.huiztech.maystall.mvc.MaystallView;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;


public class UserSafetyActivity extends BaseActivity{

	private Button backBtn;
	private ImageButton submitBtn;
	private Controller controller;
	private MaystallView view;
	
	private EditText passEdit,setPassEdit,confirmPassEdit;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_user_safety);
		
		controller = new Controller(view, UserSafetyActivity.this);
		
		passEdit = (EditText) findViewById(R.id.user_safety_pass_edit);
		setPassEdit = (EditText) findViewById(R.id.user_safety_setpass_edit);
		confirmPassEdit = (EditText) findViewById(R.id.user_safety_confirmpass_edit);
		backBtn = (Button) findViewById(R.id.user_safety_back_btn);
		submitBtn = (ImageButton) findViewById(R.id.user_safety_submit_btn);
		
		backBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		
		submitBtn.setOnClickListener(new OnClickListener() {
            
            @Override
            public void onClick(View v) {
                controller.changePassword("", passEdit.getText().toString(), setPassEdit.getText().toString(), confirmPassEdit.getText().toString());
                finish();
            }
        });
		
	}
}
